package gui.menus;

import java.util.Vector;

import core.Profile;
import core.Score;
import core.ScoreBoard;
import core.Voice;

public class ScoreBoardFrame extends MenuAbstrait {
	
	private Vector<Score> scores;

	public ScoreBoardFrame(Profile p, String title) {
		super(p, title);
		scores = ScoreBoard.getInstance().getScores();
		Voice.getInstance().play("Voici les meilleurs scores");
	}

	@Override
	protected String[] nomOptions() {
		String textScores[] = new String[scores.size()];
		for (int i = 0; i < textScores.length; i++) {
			Score currentScore = scores.get(i);
			textScores[i] = currentScore.getName() + " - Score : " + currentScore.getAverageReactionTime();
		}
		return textScores;
	}

	@Override
	protected void lancerOption(int i) {
		Score currentScore = scores.get(i);
		Voice.getInstance().play("Le joueur " + currentScore.getName() + " a obtenu un score de " + currentScore.getAverageReactionTime());
	}

	@Override
	protected String wavAccueil() {
		return null;
	}

	@Override
	protected String wavRegleJeu() {
		return null;
	}

	@Override
	protected void init(Object[] args) {}
}
